FROM harbordev.zlattice.top/library/node:alpine as builder

WORKDIR /app

# RUN corepack enable
COPY . .
RUN npm config set registry https://registry.npmmirror.com
RUN npm install -g pnpm
RUN pnpm config set registry https://registry.npmmirror.com
RUN pnpm i
RUN pnpm run build

FROM harbordev.zlattice.top/library/nginx as runner

COPY --from=builder /app/nginx.conf /etc/nginx/nginx.conf
COPY --from=builder /app/dist /usr/share/nginx/html
